/* ================================================================================
//	Crypteviant!
//	Providing tough encrypted P2P Chat
//	Copyright (C) 2010  Martin Pfeifer, Tobias Rausch
//
//	This program is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program.  If not, see <http://www.gnu.org/licenses/>.
// ============================================================================== */

#include "testentropypooldata.hpp"

void TestEntropyPoolData::testAddingData_data()
{
    // Create two colums for data an the corresponding hash
    QTest::addColumn<QString>("data");
    QTest::addColumn<QString>("hash");

    // Add some lines to the data table
    QTest::newRow("500 mixed chars") << "4Ifk3rfoIJFUgoMRhDpNwqxxwivkRdEihPfRGKH6CSCmATupeP4zKmyN9jWLGjskL93LXrgI4rbZ2GpbJLt796rzdaBktqL6eqbgfTuVpZNRBs3WBXnMlhyps2FlFXOCIjeW11rH2wWXHRPAiGeZKlZuf2ZEjYDZFcCermBS079Rm1kSdfvkHqVGwd2gxOK9KZ5eVYo99yJcpmMIUmy9KReQ5uELh7nEEkhq9WhGUv6eATwLDXejexMO0Crle0sqOK2YL8r3fuCmrkW9Diuk38ysaLNfhuEYuUEAEoFElRv0qa8WZIT9NOFGAPdd84jb91OGFtbya7KKga6O7WbWNZy56HeXOeLM8FFzikf5LkveZtUZn5Ie5ne4nu6krdn4KvzrzwSnCDS0TYXm8H3KaZCJ5aQlmfh7oDoJJlur57wxwcy4i61jD244SgGA8uBecqOP3YzIaJtbVsfkzvTz3pJCSOi3vsnT456EeFQhaA84WCCYuHx9"
        << "62B7187091A5572A60045A56486DC60B2D69F3EF38837A220CC9DBEDF55D2CDF0532C7AE9D99AF3952F08233B227D7CF2A404BF4F2B40041C64884338A122BFC";

    QTest::newRow("500 numbers") << "49891418249834977199912767365048485277411496703707943677638564892575489861777901799023373424963252023510072201471902147568350200891682269938719144282705959849824988145627045259471367390304437466114065994182422335815674792803358660339496903617726569526359151417896040075778922233154997487861699539248421891662712057073126352713881429561758694985029277583700908229321651267197137998054896448038042789578824614260795059802492306803415008263158631531871191276181985023977846851947937395838668950224111358"
        << "92D1EBECD7704A0B1BBF03AC1599B20DE5CDC5D8DD2FC21DB29B4D4DEA85499081F5663838DEB4E11DD25E91CC1F0E58B7BF39CE74E06691732943FE700CD79D";

    QTest::newRow("special characters") << "h^Kv85gdIp%B0O%wBs<h1{ZE{'v]6,&C'2 $ U6dYDbsnFI</^D,A%mwP+G20=P$k)A(SmbO4UvnKq5{]xol0:^j.g;:s2?S-_2IerA[N,>PD>{(A=Fw]l0^{aay{j7*#aSaE=W#NQ9yDmn?l}G;*4C-Z/-=I.%w{WVJ^qASJ(?790Z_[yu2&8,EWZQdmTC66d3h?qbZT&vOT/<ryuIl;6=Qzi-VX{us1xObU)3bH}8d5x.ud9%,eb[[?m;ow%:-dbKRpXp$ic^gq<3fV@`.ltEq6Y*@p=$q0fo=0i{a$TJ*0l&2#=NIf`={]C&*WoX)jthmjnK2/YGAX?>8-JW#]+]I]v*QB&L+9JlzT}%up%$pq7Cnu/=.vgESr[lL_T/-x>q,,256tl!5}8YZ=fuV2 O+>V]=<>r^MKfSx[h>Ip<P:`sN0Xhyx7GrTuc:4fN#m20#D#emFHTq-ZDt@a/-'KvtF<b/^+<_'k^cbvibEK} Kh<o)ce#"
        << "E3C6FFAC0795C1DA7261D577ACE98C04EFF2311B3F33C7E0786A567F8E89E382121C30AE7AE8D21B37069771C2A7129E03AF3AD932297B0EA260B1AB5FD8079B";
}


void TestEntropyPoolData::testAddingData()
{
    // Get data out of the data table
    QFETCH(QString, data);
    QFETCH(QString, hash);

    // Add data to the Pool and get the hashed value
    EntropyPool pool;
    pool.addData(data);
    QString erg = pool.getData();

    QCOMPARE(erg, hash);
}


void TestEntropyPoolData::testEmptyData()
{
    Q_ASSERT(false);
}


void TestEntropyPoolData::testWaitForData()
{
    Q_ASSERT(false);
}


QTEST_MAIN(TestEntropyPoolData)
